package com.mspbots.attendance.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @author billb
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName(value = "tenant_attendance", autoResultMap = true)
public class TenantAttendance extends TenantEntity {
    private String teamsUserId;
    private LocalDateTime logTime;
    private Boolean paid;
    private Long duration;
    private String fromType;
    private Long userId;
    private LocalDateTime createTime;
    private String timezone;
    private String timezoneOffset;
    private String action;
    private String subAction;
    private String team;
    private String username;
    private String reason;

    @TableField(exist = false)
    private Boolean timeout;

    @TableField(exist = false)
    private TicketInfo ticketInfo;

    @TableField(exist = false)
    private LocalDateTime endTime;

    @TableField(exist = false)
    private String timeStr;


    @TableField(exist = false)
    private String teamsDisplayName;

    @TableField(exist = false)
    private Long approveId;
    @TableField(exist = false)
    private String status;
    @TableField(exist = false)
    private String comments;

    @TableField(exist = false)
    private String tenantName;
    @TableField(exist = false)
    private String firstname;
    @TableField(exist = false)
    private String lastname;
    @TableField(exist = false)
    private Long managerUserId;
    @TableField(exist = false)
    private String identifier;


    @TableField(exist = false)
    private LocalDateTime approveTime;


    @TableField(exist = false)
    private LocalDateTime logTimeUpdated;

    @TableField(exist = false)
    private Long tenantUserId;

    @Builder
    public TenantAttendance(Long tenantId, String teamsUserId, LocalDateTime logTime, Boolean paid,
                            Long duration, String fromType, Long userId,
                            LocalDateTime createTime, String timezone,
                            String timezoneOffset, String action, String subAction, String team, String username,
                            String tenantName, String firstname, String lastname, Long managerUserId, LocalDateTime logTimeUpdated, Long tenantUserId) {
        this.tenantId = tenantId;
        this.teamsUserId = teamsUserId;
        this.logTime = logTime;
        this.paid = paid;
        this.duration = duration;
        this.fromType = fromType;
        this.userId = userId;
        this.createTime = createTime;
        this.timezone = timezone;
        this.timezoneOffset = timezoneOffset;
        this.action = action;
        this.subAction = subAction;
        this.team = team;
        this.username = username;
        this.tenantName = tenantName;
        this.firstname = firstname;
        this.lastname = lastname;
        this.managerUserId = managerUserId;
        this.logTimeUpdated = logTimeUpdated;
        this.tenantUserId = tenantUserId;
    }
}
